package com.ccc3gc.servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/util")
public class UtilServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ServletContext servletContext = getServletContext();
        String contextPath = servletContext.getContextPath();
        System.out.println("sdsadasdasd" + contextPath);
        System.out.println(servletContext.getServerInfo());
        servletContext.getServerInfo();
        getServletConfig();
        String test = getServletConfig().getInitParameter("test");
        String test1 = servletContext.getInitParameter("test");
        System.out.println(test);
        System.out.println(test1);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
